<?php

namespace app\admin\validates;

use think\Validate;

class AdvertiserSecondaryValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'name' => 'require|chsAlphaNum|max:50',
        'img' => 'require|max:255',
        'status' => 'require|number|in:0,1',
    ];

    /**
     * 验证字段描述
     * @var string[]
     */
    protected $field = [
        'id' => 'ID',
        'name' => '名称',
        'img' => '二维码',
        'status' => '状态',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['img', 'name', 'status'],
        'edit' => ['id', 'img', 'name', 'status'],
        'del' => ['id'],
        'status' => ['id', 'status'],
    ];
}